﻿using System;
using System.Windows.Input;

namespace SilentWebsite.ViewModels.Commands
{
    public class SimpleCommand : ICommand
    {
        public event EventHandler CanExecuteChanged;

        private readonly Action executeAction;

        public SimpleCommand(Action action)
        {
            executeAction = action;
        }

        public bool CanExecute(object parameter)
        {
            return true;
        }
        public void Execute(object parameter)
        {
            executeAction.Invoke();
        }
    }
}